import 'dart:math';
import 'package:get/get.dart' as getLibary;

class MUtil{
  static String getRandom(int count){
    Random random = Random.secure();
    List<String> path=[];
    for (var i = 0; i < count; i++) {
      int randomString = random.nextInt(10); //0-9
      path.add("$randomString");
    }
    var string = path.join(''); //list转换成字符串
    return string;
  }
  static String flowToMB(String flow){
    String value="";
    double f=double.parse(flow);
    f=f/1024.0;
    value = f.toStringAsFixed(2);
    return value;
  }

  static bool isInEnglish(){
    String? language=getLibary.Get.locale?.languageCode;
    if(language!=null&&language=='zh'){
      return false;
    }
    return true;
  }

  static bool isDefaultModel(String id){
    return id=="default";
  }
}